<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>

<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>CRUD DEMO</title>
</head>

<body>
<h2 style="text-align: center; color: blue">MANAGER CATEGORIES</h2>
<hr>
<h3 style="text-align: center; color: red;">${errors}</h3>
<form id="frmCategory" name="frmCategory" method="post" action="category.do">
  <table border="0" align="center" cellpadding="5" cellspacing="0">
    <tr>
      <td>Category Id</td>
      <td><input readonly type="text" name="txtId" value="${cate.Id}"/></td>
    </tr>
    <tr>
      <td>Category Name</td>
      <td><input size="44" type="text" name="txtName" value="${cate.Name}" /></td>
    </tr>
    <tr>
      <td>Image</td>
      <td><input type="text" name="txtImage" value="${cate.Image}" /></td>
    </tr>
    <tr>
      <td>Description</td>
      <td><textarea rows="2" cols="44" name="txtDescription">${cate.Description}</textarea></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>
      	<input type="submit" name="btnInsert" id="btnInsert" value="Insert" />
      	<input type="submit" name="btnUpdate" id="btnUpdate" value="Update" />
      	<input type="submit" name="btnDelete" id="btnDelete" value="Delete" />
      </td>
    </tr>
  </table>
  <hr/>
  <div style="text-align: center; margin: 10px;">
  	Search: <input type="text" name="txtSearch" value="${search}"/>
  	<input type="submit" name="btnSearch"value="Search" />
  </div>
  <table width="100%" border="1" align="center" cellpadding="5" cellspacing="0">
    <tr bgcolor="lightgray">
      <th>Id</th>
      <th>Name</th>
      <th>Image</th>
      <th>Description</th>
      <th>&nbsp;</th>
    </tr>
    <c:forEach var="c" items="${cates.rows}">
    <tr>
      <td>${c.Id}</td>
      <td>${c.Name}</td>
      <td>${c.Image}</td>
      <td>${c.Description}</td>
      <td><a href="?lnkEdit&txtId=${c.Id}">Edit</a></td>
    </tr>
    </c:forEach>
    </table>
</form>
</body>
</html>